from webutils.layers.services import ManagerProxy

from .. import managers
from .base import BaseService


class ConnectionService(BaseService):
    required_context = ['room_id', 'session_id']
    session_lock = ManagerProxy(managers.SessionLock)

    async def acquire_lock(self):
        return await self.session_lock.acquire()

    async def release_lock(self):
        return await self.session_lock.release()
